﻿unit NewMPFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, JvExControls, JvXPCore, JvXPButtons, Mask,
  JvExMask, JvToolEdit, JvBaseEdits, ComCtrls;

type
  TNewMPForm = class(TForm)
    Panel1: TPanel;
    JvXPButton1: TJvXPButton;
    JvXPButton2: TJvXPButton;
    GroupBox1: TGroupBox;
    Panel2: TPanel;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    D: TDateTimePicker;
    T: TDateTimePicker;
    Label3: TLabel;
    Summa: TJvCalcEdit;
    Note: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure JvXPButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  NewMPForm: TNewMPForm;

implementation

{$R *.dfm}

procedure TNewMPForm.FormCreate(Sender: TObject);
begin
 D.Date:=Date+1; T.Time:=Time;
end;

procedure TNewMPForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 case Key of
  VK_ESCAPE: ModalResult:=mrCancel;
 end;
end;

procedure TNewMPForm.JvXPButton1Click(Sender: TObject);
begin
 if D.Date<Date then
  begin
   ModalResult:=mrNone;
   ShowMessage('Указанная дата события меньше текущей.'#13+
               'Ввод мероприятий задним числом запрещен.');
  end;
end;

end.
